/**
 * All rights Reserved, Designed By www.sydtech.com.cn
 *
 * @Title ExportCsv.java
 * @Package com.sydtech.bms.util
 * @author tianch.liu
 * @date 2017-2-14 上午9:02:40
 * @version V1.0
 * @Copyright: 2017 sydtech Inc. All rights reserved.
 */
package com.sunyard.manage.util;

import java.io.ByteArrayInputStream;
import java.util.List;

/**
 * @author tianch.liu
 * @date 2017-2-14 上午9:02:40
 */
public class ExportCsv {

    /**
     * Description
     */
    public static ByteArrayInputStream exportToCsv(List<String> list) {
        StringBuilder sb = new StringBuilder();
        int j = list.size();
        for (int i = 0; i < j; i++) {
            String orders = list.get(i);
            sb = sb.append(orders + "\n");
        }
        ByteArrayInputStream stream = new ByteArrayInputStream(sb
                .toString().getBytes());
        return stream;
    }
}
